package com.spm.librarianmanagersystem.pojo;

import com.spm.librarianmanagersystem.vo.Person;

import java.util.Objects;

public class Member extends Person {
    private Integer position;

    private  Integer ReputationScore;
    public Member() {
    }
    public Member(Integer userId, String id, String password, String name,
                  Integer gender, Integer position, String email, String phoneNumber,
                  String avatar, Integer upperLimits, Integer ReputationScore) {
        super(userId, id, password, name, gender, email, phoneNumber, avatar, upperLimits);
        this.position = position;
        this.ReputationScore = ReputationScore;
    }

    public Member(Integer position, Integer ReputationScore) {
        this.position = position;
        this.ReputationScore = ReputationScore;
    }

    public Integer getPosition() {
        return position;
    }

    public Integer getReputationScore() {return ReputationScore;}

    public void setPosition(Integer position) {
        this.position = position;
    }

    public void  setReputationScore(Integer ReputationScore) {this.ReputationScore = ReputationScore;}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Member member = (Member) o;
        return Objects.equals(position, member.position) && Objects.equals(ReputationScore,member.ReputationScore);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), position,ReputationScore);
    }

    @Override
    public String toString() {
        return "Member{" +
                "position=" + position +
                ", ReputationScore='" + ReputationScore + '\'' +
                "} " + super.toString();
    }


}
